# coding=utf-8

from google.appengine.api import users
from google.appengine.ext import webapp
from google.appengine.ext.webapp import template
from utils.enums import Struct
from utils.htmlutils import setXmlType
from models import models

class SettingsHandler(webapp.RequestHandler):

    def __init__(self):
        self.struct = Struct()
        self.struct.user = users.get_current_user()
        self.struct.account = models.get_account(self.struct.user)
        self.template = "templates/main/setting.xml"

    def post(self):
        setXmlType(self.response)
        self.struct.user = users.get_current_user()

        self.response.out.write(template.render(self.template, self.struct._compile()))

